import { EChartsOption } from 'echarts'
import * as echarts from 'echarts'

export const lineOptions: EChartsOption = {
  grid: {
    left: '-50px',
    right: '1%',
    top: '2px',
    bottom: '2%',
    containLabel: true
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross',
      label: {
        backgroundColor: '#6a7985'
      }
    }
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    axisLine: {
      show: true,
      lineStyle: {
        color: '#657A8A'
      }
    },
    axisLabel: {
      showMaxLabel: true,
      showMinLabel: true
    },
    data: ['03/01', '03/05', '03/15', '03/30']
  },
  yAxis: {
    show: false,
    type: 'value'
  },
  series: [
    {
      // name: "今日",
      type: 'line',
      smooth: true,
      stack: '总量',
      symbolSize: 5,
      showSymbol: false,
      itemStyle: {
        normal: {
          color: '#1A75EA',
          lineStyle: {
            color: '#6699FF',
            width: 2
          }
        }
      },
      areaStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(
            0,
            0,
            0,
            1,
            [
              {
                offset: 0,
                color: 'rgba(102, 153, 255, 1)'
              },
              {
                offset: 0.5,
                color: 'rgba(102, 153, 255, .5)'
              },
              {
                offset: 1,
                color: 'rgba(102, 153, 255, .1)'
              }
            ],
            false
          )
        }
      },
      data: [140, 232, 101, 264, 90, 340, 250]
    }
  ]
}
export const lineOptions1: EChartsOption = {
  grid: {
    left: '-50px',
    right: '1%',
    top: '2px',
    bottom: '2%',
    containLabel: true
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross',
      label: {
        backgroundColor: '#6a7985'
      }
    }
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    axisLine: {
      show: true,
      lineStyle: {
        color: '#657A8A'
      }
    },
    axisLabel: {
      showMaxLabel: true,
      showMinLabel: true
    },
    data: ['03/01', '03/05', '03/15', '03/30']
  },
  yAxis: {
    show: false,
    type: 'value'
  },
  series: [
    {
      // name: "今日",
      type: 'line',
      smooth: true,
      stack: '总量',
      symbolSize: 5,
      showSymbol: false,
      itemStyle: {
        normal: {
          color: '#39E3AA',
          lineStyle: {
            color: '#39E3AA',
            width: 2
          }
        }
      },
      areaStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(
            0,
            0,
            0,
            1,
            [
              {
                offset: 0,
                color: 'rgba(57, 227, 170, 1)'
              },
              {
                offset: 0.5,
                color: 'rgba(57, 227, 170, .5)'
              },
              {
                offset: 1,
                color: 'rgba(57, 227, 170, .1)'
              }
            ],
            false
          )
        }
      },
      data: [140, 232, 101, 264, 90, 340, 250]
    }
  ]
}

export const lineOptions2: EChartsOption = {
  title: {
    text: '出入库统计'
  },
  xAxis: {
    data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月'],
    boundaryGap: false,
    type: 'category'
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  tooltip: {
    trigger: 'axis'
  },
  yAxis: {
    show: false,
    type: 'value'
  },
  legend: {
    data: ['出库统计', '入库统计'],
    left: '340px'
  },
  series: [
    {
      name: '出库统计',
      type: 'line',
      stack: 'Total',
      data: [120, 132, 101, 134, 90, 230, 210]
    },
    {
      name: '入库统计',
      type: 'line',
      stack: 'Total',
      data: [220, 182, 191, 234, 290, 330, 310]
    }
  ]
}
